import { GSprite } from "../../../../com/mui/controls/GSprite";
import { ObjCreate } from "../common/ObjCreate";
import { ImagesConst } from "../../resource/ImagesConst";
import { CountryMoneyRecordRenderer } from "./CountryMoneyRecordRenderer";
import { GlobalClass } from "../../../../com/mui/core/GlobalClass";
import { DataProvider } from "../../../../fl/data/DataProvider";
import { ScaleBitmap } from "../../../../com/mui/display/ScaleBitmap";
import { GTileList } from "../../../../com/mui/controls/GTileList";
//class CountryMoneyRecordPanel
    
    export  class CountryMoneyRecordPanel extends GSprite
    {
        constructor()
        {
            super();
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            this._bg = ObjCreate.createBg(0, 3, 235, 210, this);
            this._titleBg = ObjCreate.createBg(0, 0, 237, 30, this, ImagesConst.RbListHeader);
            this._titleBmp = ObjCreate.createBitmap("", 10, 3, this);
            this._recordList = ObjCreate.createTileList(7, 35, 225, 175, this);
            this._recordList.columnWidth = 220;
            this._recordList.rowHeight = 40;
            this._recordList.setStyle("cellRenderer", CountryMoneyRecordRenderer);
            return;
        }

        public set titleBmp(arg1: string)
        {
            this._titleBmp.bitmapData = GlobalClass.getBitmapData(arg1);
            return;
        }

        public updateRecord(arg1: Array<any>): void
        {
            if (this._recordList) 
            {
                this._recordList.dataProvider = new DataProvider(arg1);
                this._recordList.verticalScrollPosition = this._recordList.maxVerticalScrollPosition;
            }
            return;
        }

        /* internal */ /* var */_bg: ScaleBitmap;

        /* internal */ /* var */_titleBg: ScaleBitmap;

        /* internal */ /* var */_titleBmp: Object /* flash.display.Bitmap */;

        protected /* var */_recordList: GTileList;
    }
